{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       a  1  b  3  c  2     draw\n0      a  1  c  1  c  2     draw\n1      a  1  c  1  d  1     draw\n2      a  1  c  1  d  2     draw\n3      a  1  c  2  c  1     draw\n4      a  1  c  2  c  3     draw\n...   .. .. .. .. .. ..      ...\n28050  b  1  g  7  e  5  sixteen\n28051  b  1  g  7  e  6  sixteen\n28052  b  1  g  7  e  7  sixteen\n28053  b  1  g  7  f  5  sixteen\n28054  b  1  g  7  g  5  sixteen\n\n[28055 rows x 7 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>a</th>\n      <th>1</th>\n      <th>b</th>\n      <th>3</th>\n      <th>c</th>\n      <th>2</th>\n      <th>draw</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>a</td>\n      <td>1</td>\n      <td>c</td>\n      <td>1</td>\n      <td>c</td>\n      <td>2</td>\n      <td>draw</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>a</td>\n      <td>1</td>\n      <td>c</td>\n      <td>1</td>\n      <td>d</td>\n      <td>1</td>\n      <td>draw</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>a</td>\n      <td>1</td>\n      <td>c</td>\n      <td>1</td>\n      <td>d</td>\n      <td>2</td>\n      <td>draw</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>a</td>\n      <td>1</td>\n      <td>c</td>\n      <td>2</td>\n      <td>c</td>\n      <td>1</td>\n      <td>draw</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>a</td>\n      <td>1</td>\n      <td>c</td>\n      <td>2</td>\n      <td>c</td>\n      <td>3</td>\n      <td>draw</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>28050</th>\n      <td>b</td>\n      <td>1</td>\n      <td>g</td>\n      <td>7</td>\n      <td>e</td>\n      <td>5</td>\n      <td>sixteen</td>\n    </tr>\n    <tr>\n      <th>28051</th>\n      <td>b</td>\n      <td>1</td>\n      <td>g</td>\n      <td>7</td>\n      <td>e</td>\n      <td>6</td>\n      <td>sixteen</td>\n    </tr>\n    <tr>\n      <th>28052</th>\n      <td>b</td>\n      <td>1</td>\n      <td>g</td>\n      <td>7</td>\n      <td>e</td>\n      <td>7</td>\n      <td>sixteen</td>\n    </tr>\n    <tr>\n      <th>28053</th>\n      <td>b</td>\n      <td>1</td>\n      <td>g</td>\n      <td>7</td>\n      <td>f</td>\n      <td>5</td>\n      <td>sixteen</td>\n    </tr>\n    <tr>\n      <th>28054</th>\n      <td>b</td>\n      <td>1</td>\n      <td>g</td>\n      <td>7</td>\n      <td>g</td>\n      <td>5</td>\n      <td>sixteen</td>\n    </tr>\n  </tbody>\n</table>\n<p>28055 rows × 7 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 2
    }
   ],
   "source": [
    "data=pd.read_csv('./krkopt.data')\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 将前6列数据中的字母“a、b、c、d、e、f、g、h”分别替换为数字“1、2、3、4、5、6、7、8”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       a  1  b  3  c  2\n0      1  1  3  1  3  2\n1      1  1  3  1  4  1\n2      1  1  3  1  4  2\n3      1  1  3  2  3  1\n4      1  1  3  2  3  3\n...   .. .. .. .. .. ..\n28050  2  1  7  7  5  5\n28051  2  1  7  7  5  6\n28052  2  1  7  7  5  7\n28053  2  1  7  7  6  5\n28054  2  1  7  7  7  5\n\n[28055 rows x 6 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>a</th>\n      <th>1</th>\n      <th>b</th>\n      <th>3</th>\n      <th>c</th>\n      <th>2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1</td>\n      <td>3</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1</td>\n      <td>4</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1</td>\n      <td>1</td>\n      <td>3</td>\n      <td>1</td>\n      <td>4</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>1</td>\n      <td>3</td>\n      <td>2</td>\n      <td>3</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>1</td>\n      <td>3</td>\n      <td>2</td>\n      <td>3</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>28050</th>\n      <td>2</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>5</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>28051</th>\n      <td>2</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>5</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>28052</th>\n      <td>2</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>5</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>28053</th>\n      <td>2</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>6</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>28054</th>\n      <td>2</td>\n      <td>1</td>\n      <td>7</td>\n      <td>7</td>\n      <td>7</td>\n      <td>5</td>\n    </tr>\n  </tbody>\n</table>\n<p>28055 rows × 6 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 3
    }
   ],
   "source": [
    "data_6=data.iloc[:,:6]\n",
    "data_6.replace(['a','b','c','d','e','f','g','h'],range(1,9),inplace=True)\n",
    "data_6"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 对前6列数据进行标准差标准化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def StandardScale(data):\n",
    "    return (data-data.mean())/data.std()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "for column in data_6.columns:\n",
    "    data_6[column]=StandardScale(data_6[column])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "              a         1         b         3         c         2\n0     -2.251361 -0.921871 -0.672667 -1.538699 -0.877141 -1.090518\n1     -2.251361 -0.921871 -0.672667 -1.538699 -0.444294 -1.535283\n2     -2.251361 -0.921871 -0.672667 -1.538699 -0.444294 -1.090518\n3     -2.251361 -0.921871 -0.672667 -1.100630 -0.877141 -1.535283\n4     -2.251361 -0.921871 -0.672667 -1.100630 -0.877141 -0.645753\n...         ...       ...       ...       ...       ...       ...\n28050 -1.184004 -0.921871  1.067900  1.089715 -0.011448  0.243776\n28051 -1.184004 -0.921871  1.067900  1.089715 -0.011448  0.688541\n28052 -1.184004 -0.921871  1.067900  1.089715 -0.011448  1.133306\n28053 -1.184004 -0.921871  1.067900  1.089715  0.421398  0.243776\n28054 -1.184004 -0.921871  1.067900  1.089715  0.854245  0.243776\n\n[28055 rows x 6 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>a</th>\n      <th>1</th>\n      <th>b</th>\n      <th>3</th>\n      <th>c</th>\n      <th>2</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.877141</td>\n      <td>-1.090518</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.444294</td>\n      <td>-1.535283</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.444294</td>\n      <td>-1.090518</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.100630</td>\n      <td>-0.877141</td>\n      <td>-1.535283</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.100630</td>\n      <td>-0.877141</td>\n      <td>-0.645753</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>28050</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>0.243776</td>\n    </tr>\n    <tr>\n      <th>28051</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>0.688541</td>\n    </tr>\n    <tr>\n      <th>28052</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>1.133306</td>\n    </tr>\n    <tr>\n      <th>28053</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>0.421398</td>\n      <td>0.243776</td>\n    </tr>\n    <tr>\n      <th>28054</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>0.854245</td>\n      <td>0.243776</td>\n    </tr>\n  </tbody>\n</table>\n<p>28055 rows × 6 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 6
    }
   ],
   "source": [
    "data_6"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 将最后一列数据中的“draw”替换为1，其他值替换为-1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0        1\n1        1\n2        1\n3        1\n4        1\n        ..\n28050   -1\n28051   -1\n28052   -1\n28053   -1\n28054   -1\nName: draw, Length: 28055, dtype: int64"
     },
     "metadata": {},
     "execution_count": 7
    }
   ],
   "source": [
    "data_7=data.iloc[:,-1]\n",
    "data_7=data_7.apply(lambda x:1 if x=='draw' else -1)\n",
    "data_7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "              a         1         b         3         c         2  draw\n0     -2.251361 -0.921871 -0.672667 -1.538699 -0.877141 -1.090518     1\n1     -2.251361 -0.921871 -0.672667 -1.538699 -0.444294 -1.535283     1\n2     -2.251361 -0.921871 -0.672667 -1.538699 -0.444294 -1.090518     1\n3     -2.251361 -0.921871 -0.672667 -1.100630 -0.877141 -1.535283     1\n4     -2.251361 -0.921871 -0.672667 -1.100630 -0.877141 -0.645753     1\n...         ...       ...       ...       ...       ...       ...   ...\n28050 -1.184004 -0.921871  1.067900  1.089715 -0.011448  0.243776    -1\n28051 -1.184004 -0.921871  1.067900  1.089715 -0.011448  0.688541    -1\n28052 -1.184004 -0.921871  1.067900  1.089715 -0.011448  1.133306    -1\n28053 -1.184004 -0.921871  1.067900  1.089715  0.421398  0.243776    -1\n28054 -1.184004 -0.921871  1.067900  1.089715  0.854245  0.243776    -1\n\n[28055 rows x 7 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>a</th>\n      <th>1</th>\n      <th>b</th>\n      <th>3</th>\n      <th>c</th>\n      <th>2</th>\n      <th>draw</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.877141</td>\n      <td>-1.090518</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.444294</td>\n      <td>-1.535283</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>-0.444294</td>\n      <td>-1.090518</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.100630</td>\n      <td>-0.877141</td>\n      <td>-1.535283</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>-2.251361</td>\n      <td>-0.921871</td>\n      <td>-0.672667</td>\n      <td>-1.100630</td>\n      <td>-0.877141</td>\n      <td>-0.645753</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>28050</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>0.243776</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>28051</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>0.688541</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>28052</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>-0.011448</td>\n      <td>1.133306</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>28053</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>0.421398</td>\n      <td>0.243776</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>28054</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>0.854245</td>\n      <td>0.243776</td>\n      <td>-1</td>\n    </tr>\n  </tbody>\n</table>\n<p>28055 rows × 7 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 8
    }
   ],
   "source": [
    "# 将处理后的前六列和最后一列数据合并\n",
    "data=pd.concat([data_6,data_7],axis=1)\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 随机采样5000行数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "              a         1         b         3         c         2  draw\n19874  0.950711 -0.921871  1.067900  1.089715  0.421398 -1.090518    -1\n6029   0.950711  1.236985 -0.672667 -1.538699  0.854245 -1.090518    -1\n4547  -0.116647 -0.921871 -1.107809 -1.100630 -1.742833  0.688541    -1\n8651  -1.184004  0.157557  0.632759 -0.662561 -0.444294 -1.535283    -1\n26514 -1.184004 -0.921871  1.067900  0.213577 -1.309987  0.243776    -1\n...         ...       ...       ...       ...       ...       ...   ...\n5614  -0.116647  1.236985 -0.237525  0.213577  0.421398 -1.535283    -1\n4594  -0.116647  0.157557 -1.542950 -0.662561  0.421398 -1.535283    -1\n8529  -1.184004 -0.921871  1.067900 -0.224492 -0.444294 -1.535283    -1\n12838  0.950711  1.236985  1.503042 -0.224492  0.854245  1.133306    -1\n4690  -0.116647  1.236985  0.197617 -0.662561  0.421398 -1.535283    -1\n\n[5000 rows x 7 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>a</th>\n      <th>1</th>\n      <th>b</th>\n      <th>3</th>\n      <th>c</th>\n      <th>2</th>\n      <th>draw</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>19874</th>\n      <td>0.950711</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>1.089715</td>\n      <td>0.421398</td>\n      <td>-1.090518</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>6029</th>\n      <td>0.950711</td>\n      <td>1.236985</td>\n      <td>-0.672667</td>\n      <td>-1.538699</td>\n      <td>0.854245</td>\n      <td>-1.090518</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>4547</th>\n      <td>-0.116647</td>\n      <td>-0.921871</td>\n      <td>-1.107809</td>\n      <td>-1.100630</td>\n      <td>-1.742833</td>\n      <td>0.688541</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>8651</th>\n      <td>-1.184004</td>\n      <td>0.157557</td>\n      <td>0.632759</td>\n      <td>-0.662561</td>\n      <td>-0.444294</td>\n      <td>-1.535283</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>26514</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>0.213577</td>\n      <td>-1.309987</td>\n      <td>0.243776</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>5614</th>\n      <td>-0.116647</td>\n      <td>1.236985</td>\n      <td>-0.237525</td>\n      <td>0.213577</td>\n      <td>0.421398</td>\n      <td>-1.535283</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>4594</th>\n      <td>-0.116647</td>\n      <td>0.157557</td>\n      <td>-1.542950</td>\n      <td>-0.662561</td>\n      <td>0.421398</td>\n      <td>-1.535283</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>8529</th>\n      <td>-1.184004</td>\n      <td>-0.921871</td>\n      <td>1.067900</td>\n      <td>-0.224492</td>\n      <td>-0.444294</td>\n      <td>-1.535283</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>12838</th>\n      <td>0.950711</td>\n      <td>1.236985</td>\n      <td>1.503042</td>\n      <td>-0.224492</td>\n      <td>0.854245</td>\n      <td>1.133306</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>4690</th>\n      <td>-0.116647</td>\n      <td>1.236985</td>\n      <td>0.197617</td>\n      <td>-0.662561</td>\n      <td>0.421398</td>\n      <td>-1.535283</td>\n      <td>-1</td>\n    </tr>\n  </tbody>\n</table>\n<p>5000 rows × 7 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 9
    }
   ],
   "source": [
    "data.sample(5000)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7-final"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}